New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change default cmake_layout() source folder #9596
Conversation
@@ -216,12 +216,12 @@ def get_cmake_lib_files(name, version, package_name="Pkg"): | |||
package_name=package_name), | |||
"src/{}.cpp".format(name): source_cpp.format(name=name, version=version), | |||
"src/{}.h".format(name): source_h.format(name=name, version=version), | |||
"src/CMakeLists.txt": cmake_v2.format(name=name, version=version), | |||
"CMakeLists.txt": cmake_v2.format(name=name, version=version), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we want to follow CMake common pattern that is the top root uses a add_subdirectory(src)
and keep a CMakeLists.txt inside "src" with the heavy logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't having two CMakeLists.txt
be too verbose? I mean, what would go into the root file, besides the add_subdirectory()
call?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is verbose because it is a hello-world simple example. But it would probably be the most common layout out there in CMake projects. It will contain the project(), cmake_minimum_required() and the add_subdirectory()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks completely unnecessary to me, but if it's the consensus, who am I to disagree 😄 What do you think, @lasote ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont want to see two CMakeLists.txt in a hello world, please.
Please, target the PR to |
Changelog: Feature: Change default
cmake_layout()
source folder from 'src' to '.'Docs: conan-io/docs#2225
Closes #9549